package com.lhn.dao.impl;

import com.lhn.dao.BookDao;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;


/**
 * @author lhn
 * @date 2024-08-19 13:54
 */
@Repository("bookDao")
@Scope("prototype")
//@Scope("singleton")   //单例
public class BookDaoImpl implements BookDao {
    @Override
    public void save() {
        System.out.println("book dao save ...");
    }

    @PostConstruct  //初始化方法
    public void init() {
        System.out.println("init...");
    }
    @PreDestroy //销毁方法
    public void destroy() {
        System.out.println("destroy...");
    }
}
